home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
726-750
/
744
/
fo2
/
sources_fo2
/
bitmap.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-18
|
859b
|
54 lines
#include "defs.h"
Prototype BitMap();
Prototype SetBinBM(WORD bloc,LONG *adrbm);
BitMap()
{
struct DiskList *dlist;
struct RootB *adr;
WORD n;
LONG *buffbm,SBM=0;
buffbm=BBM;
dlist=whereB(880);
if (dlist==0) NotSet(880,9);
adr=dlist->dl_AdrB;
adr->BitMapTable[0]=881L;
adr->BMvalid=-1;
/*printf("GFree: %d DFree: %d\n",GFree,DFree);*/
for (n=0;n!=56;n++) buffbm[n]=-1L; /* on nettoye le BitMap */
for (n=56;n!=128;n++) buffbm[n]=0L;
if (DFree<880)
{
for (n=0;n<DFree;n++) SetBinBM(n,buffbm);
}
else
{
for (n=0;n!=880;n++) SetBinBM(n,buffbm);
for (n=DFree+1;n!=1761;n++) SetBinBM(n,buffbm);
}
for (n=880;n!=GFree;n++) SetBinBM(n,buffbm);
buffbm[0]=0L;
for (n=0;n!=128;n++)
{
SBM+=buffbm[n];
}
buffbm[0]=-SBM;
}
SetBinBM(bloc,adrbm)
WORD bloc;
LONG *adrbm;
{
adrbm++;
adrbm[(bloc-2)/32] &= ~(1<< ( (bloc-2)%32 ));
}